
let { CBaseSkill } = require("./baseSkill"); //导入，右边是对象，左边才能使用{右边对象的键名}这样定义

class CSkill8006 extends CBaseSkill {
    //子类构造要调用父类构造
    constructor() {
        super(); //当子类继承父类后，子类构造要调用父类构造
        this.id = 8006;
        this.name = "剧毒弹";
        this.desc = "敌人受到剧毒持续伤害";
        this.program = [0.5,3];
    }

    //=========start=========
    load() {
        let damageRatio = this.program[0];//持续伤害比例
        let time = this.program[1];//持续时间
        let obj = this.owner.getDeBuffSkill(this.id);
        if (obj) { 
            obj.damageRatio += damageRatio;
        }
        else {
            this.damageRatio = damageRatio;
            this.time = time;
            obj = this.owner.addDeBuffSkill(this);
        }
    }

    unload() {
        this.owner.removeDebuffSkill(this.id);
    }//卸载技能

    addDebuff(monster) {
        let damage = this.damageRatio * this.owner.attack();
        g_Buff.addBuff(monster, g_Buff.BUFF_TYPE.poision, this.time, damage);
    }
    //=========end===========
}

module.exports = CSkill8006; //导出类
    